<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Popup_Contact_Inframe.aspx.vb" Inherits="MIMS_WRS.Web.Popup_Contact_Inframe" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>Popup_Contact_Inframe</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<LINK href="../style.css" type="text/css" rel="stylesheet">
		<script language="JavaScript" src="../function.js" type="text/JavaScript"></script>
		<script language="javascript" src="../Js/EventCapture.js"></script>
		<script language="javascript">
			<!--
			var cId = <%= GetSelectedCustomer %>;
			function Select_onclick(hrf) {
				
					var obj = new Object();
					obj.Name = hrf.lang; 
					obj.ID = hrf.language; 
					window.returnValue=obj;
					window.close();
			}
			
			function OpenDlg(url, title, w, h) 
			{	
				var lpos=(screen.width - w)/2;
				var tpos=(screen.height - h)/2;		

				var reval=0;
				url = escape(url);
				reval = window.showModalDialog('../Dialogs/ShowDialog.aspx?title='+escape(title)+'&src='+url,"","dialogHeight: " + h + "px; dialogWidth: " + w + "px; dialogTop: " + tpos + "px; dialogLeft: " + lpos + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")

				if (reval != null) 
				{	
					if (window.document.getElementById('btnRefresh'))
					{
						window.document.getElementById('btnRefresh').click();
					}
				}
				
				return false;
			}
			
			function ConfirmRemoveObj(action, object, obj)
			{
				if (confirm("Are you sure you want to " + action + " "+ object +"?")) 
				{
					window.Form1.removeCID.value = obj.name;
					
					return true;
				}
				else
				{
					return false;
				}
			}
			//-->
		</script>
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td vAlign="top" align="right" height="100%"><A onclick="javascript:OpenDlg('CustomerContactDialog.aspx?cid=' + cId, 'Create new Customer Contact', 360, 140); return false;"
							href="javascript:doNothing()"><IMG height="18" alt="New" hspace="2" src="../images/b_createnew.gif" width="70" border="0"></A>
						<asp:datagrid id="dgDataList" runat="server" Width="100%" BorderWidth="0px" BorderColor="#BFD6FB"
							AutoGenerateColumns="False" AllowSorting="True" CellSpacing="1" CellPadding="3" CssClass="border">
							<ItemStyle HorizontalAlign="Left" CssClass="bggrey" VerticalAlign="Middle"></ItemStyle>
							<HeaderStyle HorizontalAlign="Left" CssClass="txtheader" VerticalAlign="Middle"></HeaderStyle>
							<Columns>
								<asp:TemplateColumn SortExpression="CONTACT_NAME" HeaderText="Name">
									<HeaderStyle Width="60%"></HeaderStyle>
									<ItemStyle HorizontalAlign="Left"></ItemStyle>
									<ItemTemplate>
										<a href="#" onClick='javascript:Select_onclick(this)' lang="<%# DataBinder.Eval(Container, "DataItem.CONTACT_NAME") %>" language="<%# DataBinder.Eval(Container, "DataItem.CONTACT_ID_PK") %>">
											<%# DataBinder.Eval(Container, "DataItem.CONTACT_NAME") %>
										</a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="Edit/Remove">
									<HeaderStyle Width="14%"></HeaderStyle>
									<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
									<ItemTemplate>
										<a href="javascript:doNothing();" onClick="javascript:OpenDlg('CustomerContactDialog.aspx?cid=' + cId + '&id=' + '<%# DataBinder.Eval(Container, "DataItem.CONTACT_ID_PK") %>', 'Edit Customer Contact', 360, 140); return false;">
											<img src="../images/ic_edit.gif" alt="Edit" width="13" height="12" hspace="3" border="0"></a>
										<a href="javascript:doNothing();" onClick="javascript:if(!ConfirmRemoveObj('remove', 'this customer contact', this)) return false;"
											name='<%# DataBinder.Eval(Container, "DataItem.CONTACT_ID_PK") %>' runat="server" id="href1" onserverclick="RemoveCustomerContact_Command">
											<img src="../images/ic_del.gif" width="13" height="12" hspace="3" border="0"></a>
									</ItemTemplate>
								</asp:TemplateColumn>
							</Columns>
						</asp:datagrid></td>
				</tr>
			</table>
			<asp:button id="btnRefresh" style="DISPLAY: none" runat="server" Text="Refresh"></asp:button><input id="removeCID" type="hidden" name="removeCID" runat="server">
		</form>
	</body>
</HTML>
